import 'package:flutter/material.dart';

//详情页
class DetailShop extends StatelessWidget {
  const DetailShop({super.key});
  // String goodsId;
  @override
  Widget build(BuildContext context) {
    //获取路由参数
    ModalRoute res = ModalRoute.of(context)!;
    print(res.settings.arguments);
    return Scaffold(
      appBar: AppBar(
        title: const Text('详情页'),
        backgroundColor: Colors.red,
      ),
      body: Container(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            const Text('详情页'),
            ElevatedButton(
              onPressed: () {
                // 按钮点击事件
                print('按钮被点击');
                //路由返回
                Navigator.pop(context);
              },
              child: const Text('点击我'),
            ),
          ],
        ),
      ),
    );
  }
}
